/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.x3.purchasing.order;

import com.x3.purchasing.common.ClassConnection;
import java.util.List;

/**
 *
 * @author kris
 */
public class OrderDetailDAOImpl implements OrderDetailDAO {

    public OrderDetailDAOImpl() {
        ClassConnection.getTransactionProxyFactoryBean().setTarget(this);
    }

    public void insert(OrderDetail orderDetail) throws Exception {
        String sql = "INSERT INTO detail_order(order_id,produk_id,harga_satuan,jumlah) VALUES(?,?,?,?)";
        ClassConnection.getJdbc().update(sql, new Object[]{
                    orderDetail.getOrder().getId(),
                    orderDetail.getProduk().getId(),
                    orderDetail.getHargaSatuan(),
                    orderDetail.getJumlah()
                });
    }

    public void update(OrderDetail orderDetail) throws Exception {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    public void delete(int id) throws Exception {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    public OrderDetail get(int id) throws Exception {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    public List<OrderDetail> gets() throws Exception {
        throw new UnsupportedOperationException("Not supported yet.");
    }
}
